package org.example.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.example.domain.po.ErpAccount;
import org.example.domain.po.ErpPerson;
import org.example.service.ErpPersonService;
import org.example.mapper.ErpPersonMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 14120
* @description 针对表【erp_person(经手人表)】的数据库操作Service实现
* @createDate 2024-10-29 08:35:37
*/
@Service
public class ErpPersonServiceImpl extends ServiceImpl<ErpPersonMapper, ErpPerson>
    implements ErpPersonService{

    @Override
    public Page<ErpPerson> findByPage(Page<ErpPerson> page, String perName, String type, Long tenantId) {
        return baseMapper.findByPage(page, perName, type, tenantId);
    }

    @Override
    public boolean modifyTheState(List<Integer> ids, String status) {
        return lambdaUpdate().set(ErpPerson::getStatus, status).in(ErpPerson::getPerId, ids).update();
    }

    public List<ErpPerson> selectByExample() {
        return this.baseMapper.selectByExample();
    }
    public int insert (@Param("perName") String perName, @Param("type") String type, @Param("sort") String sort, @Param("status") Integer status, @Param("tenantId") Integer tenantId){
       return this.baseMapper.insert(perName, type, sort, status, tenantId);
    }
}




